/**
 * Created by jihb on 4/12/16.
 */
Ext.define('JYnovel.view.system.LoginView',{
    extend:'Ext.window.Window',
    title:'管理系统-用户登录',
    layout:'fit',
    border:false,
    width:360,
    height:240,
    modal:true,
    resizable:false,
    closable:false,
    initComponent:function () {
        Ext.applyIf(this, {
            items:[{
                xtype:'LoginFormView'
            }]
        });
        this.callParent(arguments);
    }
});
Ext.define('JYnovel.view.system.LoginFormView',{
    extend:'Ext.form.Panel',
    alias:'widget.LoginFormView',
    layout:'anchor',
    border:false,
    defaults:{
        anchor:'100%',
        padding:10,
        labelWidth:60,
        labelAlign:'right'
    },
    initComponent:function () {
        Ext.applyIf(this, {
            items:[{
                xtype:'label',
                name:'tipLabel'
            },{
                xtype:'textfield',
                fieldLabel:'账号',
                name:'loginName',
                maxLength:50,
                maxLengthText:'最多50个字符',
                enableKeyEvents:true,
                allowBlank:false
            },{
                xtype:'textfield',
                fieldLabel:'密码',
                name:'loginPass',
                inputType:'password',
                maxLength:50,
                maxLengthText:'最多50个字符',
                enableKeyEvents:true,
                allowBlank:false
            },{
                xtype:'fieldcontainer',
                fieldLabel:'验证码',
                layout: 'hbox',
                items:[{
                    xtype:'textfield',
                    name:'vcode',
                    enableKeyEvents:true,
                    allowBlank:false
                },{
                    margin:'0 0 0 5',
                    border:false,
                    html:'<img height="25" width="80" style="cursor: pointer" src="'+getUrl('/vcode')+'" title="点击刷新" onclick="(function(obj) {obj.src=getUrl(\'/vcode\')+\'?dc=\'+new Date()  })(this);">'
                }]
            }],
            buttons:[{
                text:'登录',
                name:'loginOkBtn',
                formBind:true
            }]
        });
        this.callParent(arguments);
    }
});